﻿<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
		xmlns:tx="http://www.springframework.net/tx"
		xmlns:aop="http://www.springframework.net/aop">

	<!-- Referenced by main application context configuration file -->
	<description>
		The project service layer definitions contains transaction manager
	</description>

	<!--配置事务-->
	<object id="transactionManager"
        type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate33">
		<property name="DbProvider" ref="DbProvider"/>
		<property name="SessionFactory" ref="NHibernateSessionFactory"/>
	</object>

	<object id="transactionInterceptor" 
			type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
		<property name="TransactionManager" ref="transactionManager"/>
		<property name="TransactionAttributeSource">
			<object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data"/>
		</property>
	</object>

	<object id="txProxyTemplate"  abstract="true" 
			type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
		<property name="PlatformTransactionManager" ref="transactionManager"/>
		<property name="TransactionAttributes">
			<name-values>
				<add key="Save*" value="PROPAGATION_REQUIRED"/>
				<add key="Set*" value="PROPAGATION_REQUIRED"/>
				<add key="Finish*" value="PROPAGATION_REQUIRED"/>
				<add key="Update*" value="PROPAGATION_REQUIRED"/>
				<add key="Delete*" value="PROPAGATION_REQUIRED"/>
				<add key="Add*" value="PROPAGATION_REQUIRED"/>
				<add key="Get*" value="PROPAGATION_REQUIRED,readOnly"/>
				<add key="Find*" value="PROPAGATION_REQUIRED,readOnly"/>
				<add key="Load*" value="PROPAGATION_REQUIRED,readOnly"/>
				<add key="*" value="PROPAGATION_REQUIRED"/>
			</name-values>
		</property>
	</object>

	<!-- Bussiness Logical Service Layer -->
	<object id="UserService" parent="txProxyTemplate">
		<property name="Target">
			<object type="YiLe.BLL.ServiceImpl.UserService, YiLe.BLL">
				<property name="UserDao" ref="UserDao"/>
			</object>
		</property>
	</object>

	<object id="RoleService" parent="txProxyTemplate">
		<property name="Target">
			<object type="YiLe.BLL.ServiceImpl.RoleService, YiLe.BLL">
				<property name="RoleDao" ref="RoleDao"/>
			</object>
		</property>
	</object>

	<object id="PermissionService" parent="txProxyTemplate">
		<property name="Target">
			<object type="YiLe.BLL.ServiceImpl.PermissionService, YiLe.BLL">
				<property name="PermissionDao" ref="PermissionDao"/>
			</object>
		</property>
	</object>

	<object id="MenuService" parent="txProxyTemplate">
		<property name="Target">
			<object type="YiLe.BLL.ServiceImpl.MenuService, YiLe.BLL">
				<property name="MenuDao" ref="MenuDao"/>
			</object>
		</property>
	</object>

	<object id="XS_CodeService" parent="txProxyTemplate">
		<property name="Target">
			<object type="YiLe.BLL.ServiceImpl.XS_CodeService, YiLe.BLL">
				<property name="CodeDao" ref="XS_CodeDao"/>
			</object>
		</property>
	</object>

	<object id="Xs_TableService" parent="txProxyTemplate">
		<property name="Target">
			<object type="YiLe.BLL.ServiceImpl.Xs_TableService, YiLe.BLL">
				<property name="TableDao" ref="Xs_TableDao"/>
			</object>
		</property>
	</object>
</objects>